<template>
  <component
    :is="dynamicComponent"
    v-bind="{ ...$attrs, ...$props }"
    v-on="$listeners"
  />
</template>

<script>
import store from '@/mixins/store'
import Template from './Template'
import Custom from './Custom'

export default {
  computed: {
    generateType() {
      return store.generateType
    },
    dynamicComponent() {
      if (this.generateType === 'custom') return Custom

      return Template
    }
  }
}
</script>

<style lang="scss" scoped></style>
